Skip to content

fix(render): don't pre-create file bind-mount sources as directories - #680

Merged
Gerrrt merged 1 commit into
mainfrom
gerrrt/render-file-mounts-soc
Sep 27, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
gerrrt/render-file-mounts-soc

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 27, 2026

Copy link
Copy Markdown
Owner

The bug

render-config.sh pre-creates every gitignored compose bind-mount source so Docker won't create it root-owned at up time. That block assumed every gitignored source is a directory.

The soc stack is the first to bind-mount individual gitignored files:

  • wazuh/certs/*.pem — written by the wazuh.certs-generator profile
  • wazuh/indexer/.rendered/internal_users.yml, wazuh/manager/.rendered/authd.pass — written by render itself, moments later in the same run

The loop mkdir -p'd those paths as directories. Render then failed writing internal_users.yml over the directory it had just made:

... > .../indexer/.rendered/internal_users.yml   → "Is a directory"

This surfaced building odin (#266/#267): make render STACK=soc could not complete.

The fix

Skip a gitignored source whose basename carries a filename extension — ?*.*, "a dot that is not the first character", so a .rendered dotdir is still pre-created, while authd.pass, admin.pem, internal_users.yml are left to their producers. Files a producer writes before make up don't need pre-creating; only directories do.

No behaviour change for the observability/lab/sensitive stacks (their runtime sources are directories). shellcheck-clean.

🤖 Generated with Claude Code

render-config.sh pre-creates every gitignored compose bind-mount source
so Docker doesn't make it root-owned. That block assumed every such
source is a directory. The soc stack is the first to bind-mount
individual gitignored FILES — wazuh/certs/*.pem (written by the certs
generator) and .rendered/internal_users.yml, .rendered/authd.pass
(written by render itself moments later). The loop mkdir'd those paths
as directories, and render then failed writing internal_users.yml over
the directory it had just created ("Is a directory").

Skip a gitignored source whose basename carries a filename extension
(`?*.*` — a dot that isn't the first character, so `.rendered` dotdirs
are still created); it's a file its producer writes before `make up`,
not a directory to pre-create.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit 4ff097e into main Sep 27, 2026
7 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/render-file-mounts-soc branch September 27, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant